#ifndef OCL_TYPE_H
#define OCL_TYPE_H

namespace ocl
{
// http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/
// Built-in scalar data types

struct NullType {};
template <typename T> struct IsValid{enum {value_type = false};};
template <typename T> struct Std2Ocl {typedef NullType ResultType;};

// IsValid
template<> struct IsValid<char>             {enum {value_type = true};};
template<> struct IsValid<unsigned char>    {enum {value_type = true};};
template<> struct IsValid<short>            {enum {value_type = true};};
template<> struct IsValid<unsigned short>   {enum {value_type = true};};
template<> struct IsValid<int>              {enum {value_type = true};};
template<> struct IsValid<unsigned int>     {enum {value_type = true};};
template<> struct IsValid<long>             {enum {value_type = true};};
template<> struct IsValid<unsigned long>    {enum {value_type = true};};
template<> struct IsValid<float>            {enum {value_type = true};};
template<> struct IsValid<cl_mem>           {enum {value_type = true};};

// Std2Ocl
template<> struct Std2Ocl<char>             {typedef cl_char    ResultType;};
template<> struct Std2Ocl<unsigned char>    {typedef cl_uchar   ResultType;};
template<> struct Std2Ocl<short>            {typedef cl_short   ResultType;};
template<> struct Std2Ocl<unsigned short>   {typedef cl_ushort  ResultType;};
template<> struct Std2Ocl<int>              {typedef cl_int     ResultType;};
template<> struct Std2Ocl<unsigned int>     {typedef cl_uint    ResultType;};
template<> struct Std2Ocl<long>             {typedef cl_long    ResultType;};
template<> struct Std2Ocl<unsigned long>    {typedef cl_ulong   ResultType;};
template<> struct Std2Ocl<float>            {typedef cl_float   ResultType;};
//template<> struct Std2Ocl<double>           {typedef cl_double  ResultType;};
template<> struct Std2Ocl<void>             {typedef void       ResultType;};


}
#endif
